
package com.insigma.business.qrcode.common.converter;


import com.insigma.business.qrcode.soldier.dto.GovEmployeeDTO;
import com.insigma.business.qrcode.soldier.entity.GovEmployeeDO;
import com.insigma.business.qrcode.common.converter.AbstractConverter;
import org.springframework.beans.BeanUtils;


public class GovEmployeeProviderConverter extends AbstractConverter<GovEmployeeDTO, GovEmployeeDO> {

    private final static GovEmployeeProviderConverter govEmployeeConverter = new GovEmployeeProviderConverter();

    private GovEmployeeProviderConverter(){}



    @Override
    protected GovEmployeeDTO doConvertResponseDO2DTO(GovEmployeeDO govEmployeeDO) {
        final GovEmployeeDTO govEmployeeDTO = new GovEmployeeDTO();
        try {
            BeanUtils.copyProperties(govEmployeeDO, govEmployeeDTO);
        }catch(RuntimeException be){
            
            return null;
        }
        return govEmployeeDTO;
    }

    public static GovEmployeeDTO convertResponseDO2DTO(final GovEmployeeDO govEmployeeDO){
        return govEmployeeConverter.convertGenericResponseDO2DTO(govEmployeeDO);
    }

}
